package com.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Controller {
		
	@RequestMapping(value = "/available", method = RequestMethod.GET	)
	public String availabieService() {	
		return "This Server works well.";
	}
	
	@RequestMapping(value = "/unavailable", method = RequestMethod.GET	)
	public String unavailableServicve() {
		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		return "This service is unavailable.";
	}
}
